package ObserverModel2;

/**
 * Created by Lenovo on 2017/5/15.
 */
public class ConcreteSubject extends Subject {

    private WeatherBean weatherBean;

    public ConcreteSubject(WeatherBean weatherBean) {
        this.weatherBean = weatherBean;
    }

    /**
     * 设置季节变换和天气变换
     *
     * @param weatherBean
     */
    public void setWeatherBean(WeatherBean weatherBean) {
        this.weatherBean = weatherBean;

        this.Notify();
    }

    public WeatherBean getWeatherBean() {
        return weatherBean;
    }

    /**
     * 季节变换
     *
     * @param season
     */
    public void setSeason(String season) {
        weatherBean.setSeason(season);

        this.Notify();
    }

    /**
     * 天气变换
     *
     * @param weather
     */
    public void setWeather(String weather) {
        weatherBean.setWeather(weather);

        this.Notify();
    }

    @Override
    public String toString() {
        return "ConcreteSubject{" +
                "weatherBean=" + weatherBean +
                '}';
    }
}
